// 话题
const mongoose = require('mongoose')
const topicsSchema = new mongoose.Schema({
    // 话题名称
    name: {
        type: String,
        required: true,
        select: true
    },
    // 话题图片
    avatar_url: {
        type: String
    },
    // 话题简介
    introduction: {
        type: String,
        select: false
    },
    __v: {
        type: Number,
        select: false
    },
    // 话题的创建者 
    user: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'Users',
        required: true,
        select: true
    }
}, {timestamps: true})
module.exports = mongoose.model('Topics', topicsSchema)
